package com.alibaba.dubbo.consumer.controller;

import com.alibaba.common.api.entity.UserInfo;
import com.alibaba.common.api.service.INacosServiceTest;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author HeBiao
 * @Date 2021/7/2 18:51
 * @Description
 */
@RestController
@RequestMapping("/nacos/test")
public class INacosServiceTestController {
    @Reference(version = "1.0.0",group = "demo")
    private INacosServiceTest iNacosServiceTest;

    @GetMapping("/getUserInfo")
    public ResponseEntity<UserInfo> getUserInfo() {
        UserInfo userInfo = iNacosServiceTest.getUserInfo();
        return ResponseEntity.ok(userInfo);
    }
}
